﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;


class SortStrings
{
    static List<string> ReadLines()
    {
        StreamReader names = new StreamReader("names.txt");
        List<string> lines = new List<string>();
        using (names)
        {
            string line;
            while ((line = names.ReadLine()) != null)
            {
                lines.Add(line);

            }
        }
        return lines;
    }
    static void WriteLines(List<string> lines)
        {
           
            StreamWriter sortedNames = new StreamWriter("sortedNames.txt", false);
            using (sortedNames)
            {
                foreach (string line in lines)
                {
                    sortedNames.WriteLine(line);
                }
            }
            
        }
    static void Main(string[] args)
    {
        List<string> lines = ReadLines();
        lines.Sort();
        WriteLines(lines);
    }
}
            
                               
          
            

                  
          
    

